//
//  CJRewardVideoAd.h
//  CJMobileAd
//
//  Created by JJ on 2022/2/26.
//  Copyright © 2022 JJ. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN
@class CJRewardVideoAd;
@protocol CJRewardVideoAdDelegate <NSObject>

// 达到奖励条件
- (void)rewardVideoOnRewarded:(CJRewardVideoAd *)rewardAd requestId:(NSString *)requestId;

// 加载成功
- (void)rewardVideoAdDidLoad:(CJRewardVideoAd *)rewardAd resourceId:(NSString *)resourceId;

// 加载失败
- (void)rewardVideoAdLoadFailed:(CJRewardVideoAd *)rewardAd error:(NSError *)error;

// 点击
- (void)rewardVideoAdOnClicked:(CJRewardVideoAd *)rewardAd;

// 关闭
- (void)rewardVideoAdOnClosed:(CJRewardVideoAd *)rewardAd;

@end

@interface CJRewardVideoAd : NSObject

@property (nonatomic,weak) id <CJRewardVideoAdDelegate> delegate;

// 无奖励验证
- (instancetype)initWithResourceId:(NSString *)resourceId;

// 含奖励验证（默认验证方式）
- (instancetype)initWithResourceId:(NSString *)resourceId
                            userId:(NSString *)userId
                            extend:(NSString *)extend;

// 含奖励验证(带验证方式配置mode： 0（默认在视频达到奖励时进行回调）1:提前在视频展示时进行回调)
- (instancetype)initWithResourceId:(NSString *)resourceId
                            userId:(NSString *)userId
                            extend:(NSString *)extend
                  verificationMode:(NSInteger)mode;

- (void)loadAdData;

- (void)showFromRootViewController:(UIViewController *)rootViewController;

@end

NS_ASSUME_NONNULL_END
